fix: serialize VCS tests to prevent race conditions (EME-368)#2811
Merged
runningcode merged 2 commits intomasterfrom Sep 29, 2025
Merged
fix: serialize VCS tests to prevent race conditions (EME-368)#2811runningcode merged 2 commits intomasterfrom
runningcode merged 2 commits intomasterfrom
Conversation
Adds serial_test dependency and #[serial(github_event_path)] attribute to: - test_find_base_sha - test_find_head_with_github_event_path This prevents race conditions when tests run in parallel, where both tests manipulate the same global GITHUB_EVENT_PATH environment variable. Fixes EME-368: Flakiness in `test_find_base_sha` CLI 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Reorder imports alphabetically as per Rust formatting standards. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
szokeasaurusrex
approved these changes
Sep 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test_find_base_shatest that was consistently failing on Windows CIserial_testdependency to serialize tests that share theGITHUB_EVENT_PATHenvironment variable#[serial(github_event_path)]attribute to both conflicting testsRoot Cause
The flakiness was caused by a race condition where two tests run in parallel and both manipulate the same global
GITHUB_EVENT_PATHenvironment variable:test_find_base_sha()test_find_head_with_github_event_path()When running in parallel (Rust's default), these tests could overwrite each other's environment variable settings, causing random failures.
Solution
Using the
serial_testcrate with#[serial(github_event_path)]ensures these specific tests run sequentially while allowing other tests to continue running in parallel.Closes EME-368
🤖 Generated with Claude Code
Note
Serializes two VCS tests using serial_test to avoid GITHUB_EVENT_PATH race; adds serial_test as a dev dependency.
#[serial(github_event_path)]totest_find_head_with_github_event_pathandtest_find_base_shainsrc/utils/vcs.rs.serial_testinCargo.toml.Cargo.lockwithserial_testand transitive deps (scc,sdd) and includeserial_testinsentry-clipackage deps.Written by Cursor Bugbot for commit c6c76f3. This will update automatically on new commits. Configure here.